package com.lab.labspring.controller;


import com.lab.labspring.req.AdminLoginReq;
import com.lab.labspring.resp.AdminLoginResp;
import com.lab.labspring.resp.CommonResp;
import com.lab.labspring.service.LabAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private LabAdminService adminService;

    @RequestMapping("/login")
    public CommonResp<AdminLoginResp> login(@RequestBody AdminLoginReq adminLoginReq){
        AdminLoginResp resp = adminService.login(adminLoginReq);
        return new CommonResp<>(resp);
    }
}
